<template>
  <div class="inv-con">
    <div class="inv">
      <img :src="data.inviteBannerPic" alt="">
    </div>
    <!--商户-->
    <div class="merchantbox box_siz">


            <img class="marimg" :src="data.headImg" alt=""/>
            <p class="martxt">{{data.userName}}</p>


    </div>
    <div class="code" v-show="invitation">
      <img :src="data.qrCodeUrl" alt="">
      <span>长按保存手机<br>分享好友赚钱</span>
    </div>

    <!--<div class="footer">-->
      <!--<div class="btn">-->
        <!--<img src="../../assets/images/newimg/btnBg.png" alt="">-->
        <!--<span>保存图片</span>-->
      <!--</div>-->
      <!--<span>转发好友</span>-->
    <!--</div>-->

  </div>
</template>
<script>
export default {

  data () {
    return {
      activityId: '',
      userOpenId: '',
      data: '',
      invitation:true
    }
  },
  methods: {

  },
  mounted () {
    var that = this
    this.activityId = this.$route.params.activityId
    this.userOpenId = this.$route.params.openId
    this.$http({
      method: 'get',
      url: 'http://api.wangjianxin.top/invite?activityId=' + that.activityId + '&userOpenId=' + that.userOpenId
    }).then(function (res) {
      if (res.status === 200) {
        that.data = res.data
        if(res.data.isPay === 1){
          alert('请先购买才能分享赚钱～')
          that.thinvitation = false;
        }else{
          that.thinvitation = true;
        }
        console.log(that.data)
      }
    })
  }
}
</script>
<style scoped>
  .inpbtn{
    width:1rem;
    height:1rem;
    background:#ccc;
    z-index:9999;
    position: fixed;
    top:0;
    left: 0;
  }
  .inv-con{
    width: 100%;
    height: 100vh;
    overflow: hidden;
    position: relative;
    background: #1d1d1d;
  }
  .inv img{
    position: absolute;
    left: 0;
    right: 0;
    z-index: 1;
    width: 100vw;
    height:80vh;
  }
  .code{
    font-size: .3rem;
    color: #fff;
    /*flex-direction: row;*/
    /*align-items: center;*/
    position: fixed;
    /*margin-top: 63vh;*/
    bottom: 2rem;
    z-index: 2;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: space-around;
  }
  .code img{
    width: 2rem;
    height: 2rem;
  }
  .code span{
    /*width: 3rem;*/
    line-height: .8rem;
  }
  /*商户*/

  .merchantbox {
    width: 7.5rem;
    /*height: 3.4rem;*/
    position: fixed;
    top:0.7rem;
    z-index:99;
    text-align: center;
    font-size: 0;
  }


  .marimg {
    width: 0.96rem;
    height: 0.96rem;
    /*display: block;*/
    border-radius: 50%;
  }

  .martxt {
    /*width:1rem;*/
    font-size: 0.22rem;
    font-family: PingFang-SC-Bold;
    font-weight: bold;
    color: rgba(243, 184, 121, 1);
    line-height:0.5rem;

  }

  .marttext {
    color: rgba(107, 107, 107, 1);
  }
  /* btn */
  .footer{
    position: fixed;
    bottom:-0.3rem;
    z-index: 3;
    margin-left: .8rem;
  }
   .btn img{
     margin-bottom: 1rem;
     width: 6rem;
   }
  .btn span,.footer span{
    position: absolute;
    top: .25rem;
    letter-spacing: .1rem;
    left: 2.2rem;
    font-size: .34rem;
    color: #F4C08E;
  }
  .footer>span{
    top: 1.4rem;
  }
</style>
